package com.ycxy.springsecuritycourse.controller;

import com.ycxy.springsecuritycourse.entity.AjaxResult;
import com.ycxy.springsecuritycourse.entity.Users;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    @GetMapping("/test")
    @PreAuthorize("hasAuthority('ADMIN')")
    public AjaxResult test()  {
        return AjaxResult.success();
    }
}
